<?php

/**
 * Itinerario form base class.
 *
 * @package    form
 * @subpackage itinerario
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseItinerarioForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'           => new sfWidgetFormInputHidden(),
      'dia'          => new sfWidgetFormInput(),
      'mes'          => new sfWidgetFormInput(),
      'salida'       => new sfWidgetFormInput(),
      'llegada'      => new sfWidgetFormInput(),
      'hora_sal'     => new sfWidgetFormTime(),
      'hora_lleg'    => new sfWidgetFormTime(),
      'importe'      => new sfWidgetFormInput(),
      'id_rendicion' => new sfWidgetFormDoctrineSelect(array('model' => 'Rendicion', 'add_empty' => false)),
      'id_afiliado'  => new sfWidgetFormDoctrineSelect(array('model' => 'Afiliado', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'           => new sfValidatorDoctrineChoice(array('model' => 'Itinerario', 'column' => 'id', 'required' => false)),
      'dia'          => new sfValidatorInteger(),
      'mes'          => new sfValidatorInteger(),
      'salida'       => new sfValidatorInteger(),
      'llegada'      => new sfValidatorInteger(),
      'hora_sal'     => new sfValidatorTime(),
      'hora_lleg'    => new sfValidatorTime(),
      'importe'      => new sfValidatorInteger(),
      'id_rendicion' => new sfValidatorDoctrineChoice(array('model' => 'Rendicion')),
      'id_afiliado'  => new sfValidatorDoctrineChoice(array('model' => 'Afiliado')),
    ));

    $this->widgetSchema->setNameFormat('itinerario[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Itinerario';
  }

}